import request from '@/utils/request'

// 获取地区字典树接口
export function getDetailDictList(params) {
  return request({
    url: 'api/dict/detail/getDictList/',
    method: 'get',
    params
  })
}

// 获取地区字典树接口
export function setDictList(params) {
  return request({
    url: 'api/dict/detail/setDictList/',
    method: 'get',
    params
  })
}

// 获取所有的字典树
export function getDictDetail(params) {
  return request({
    url: 'api/dict/detail/',
    method: 'get',
    params
  })
}

// 获取所有的字典列表
export function getDictList(params) {
  return request({
    url: 'api/dict/detail/list/',
    method: 'get',
    params
  })
}

export function add(data) {
  return request({
    url: 'api/dict/detail/',
    method: 'post',
    data
  })
}

export function del(id) {
  return request({
    url: 'api/dict/detail/' + id + '/',
    method: 'delete'
  })
}

export function edit(id, data) {
  return request({
    url: 'api/dict/detail/' + id + '/',
    method: 'put',
    data
  })
}

export function multiDelete(ids) {
  return request({
    url: 'api/dict/detail/multiple_delete/?ids=' + ids,
    method: 'delete'
  })
}
